/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package STUDENT.NGUYENSANG.OOPs.QuanLiThuVien;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
/**
 *
 * @author NSPDL
 */
public class NhapBanDoc {
    public static List<BanDoc> ListbanDoc=new ArrayList<>();
    public BanDoc newBD()
    {
        Scanner input=new Scanner(System.in);
        BanDoc bd=null;
        try{
            System.out.println("Nhap ten ban doc: "); String ten=input.nextLine();
            System.out.println("Nhap dia chi: "); String diachi=input.nextLine();
            System.out.println("Nhap so dien thoai: "); String std=input.nextLine();
            int check=0;
            String loaibd=null;
            if(check==1)
            {
                loaibd="Sinh Vien";
            }
            if(check==2)
            {
                loaibd="Hoc vien cao hoc";
            }
            if(check==3)
            {
                loaibd="Giao vien";
            }
            else
            {
                int mabd=ListbanDoc.size()+1000;
                bd=new BanDoc(mabd,ten,diachi,std,loaibd);
            }
        }catch(Exception e)
        {
            System.out.println("Erro!!"+e.getMessage());
        }
        return bd;
    }
    public void addBD()
    {
        BanDoc bd=newBD();
        if(bd!=null)
        {
            ListbanDoc.add(bd);
        }
    }
    public void showBD()
    {
        System.out.println("Thong tin nguoi doc");
        for(BanDoc index: ListbanDoc)
        {
            System.out.println(""+index);
        }
    }
}
